import random
import collections
with open("ips.txt","w+") as ip:
    for x in range(5000):
        t = random.randint(0,255)
        ip.write(f"172.25.254.{t}\n")

with open("ips.txt","r") as ip:
    e = set()
    q = set()
    s = list()
    t = ip.readlines()
    for i in t:
       str1 = i.replace("\n","")
       num = str1[11:]
       s.append(num)
    b = collections.Counter(s)
    for a in b:
        # print(f"172.25.254.{a}出现了{b[a]}次")
        q.add(b[a])
        p = list(sorted(q))
        if b[a] in p[-10:]:
           print(f"172.25.254.{a}出现了{b[a]}次")
    print(p[-10:])






